<template>
  <div style="text-align: left; margin-bottom: 10px">
    <!--导出用户信息excel表格-->
    <p style="display: inline-block">
      <download-excel
        class="export-excel-wrapper"
        :data="Data"
        :fields="jsonFields"
        :name="title + '-' + time + geshi"
      >
        <!-- -->
        <el-button
          class="btn"
          icon="iconfont icon-upload-copy"
          @click="BulkExport"
          >批量导出</el-button
        >
      </download-excel>
    </p>
  </div>
</template>
<script>
export default {
  name: "APP",
  components: {},
  data() {
    return {
      geshi: ".xls",
      time: this.$moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss"),
      json_meta: [
        [
          {
            " key ": " charset ",
            " value ": " utf- 8 ",
          },
        ],
      ],
    };
  },
  props: {
    Data: {
      type: Array,
      default: null,
    },
    jsonFields: {
      type: Object,
      default: null,
    },
    title: {
      type: String,
      default: "数据",
    },
  },
  methods: {
    BulkExport() {
      this.$emit("BulkExport");
    },
  },
  created() {},
  mounted() {},
};
</script>
<style lang="scss" scoped>
.btn {
  // margin-left: 10px;
  // width: 108px;
  height: 36px;
  background-color: #126bff;
  border-radius: 6px;
  opacity: 1;
  color: #ffffff;
  font-size: 16px;
  font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  font-weight: 400;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
